#pragma once


//-----------------------------------------------------------------------------
//															Matrix44 class
//-----------------------------------------------------------------------------
class Matrix44
{
public:
	Matrix44();
	Matrix44(const Matrix44& m);

	//	casting operators
	operator float* ();
	operator const float* () const;

	//	assignment operators
	Matrix44& operator= (const Matrix44& rhs);
	Matrix44& operator+=(const Matrix44& rhs);
	Matrix44& operator-=(const Matrix44& rhs);
	Matrix44& operator*=(const Matrix44& rhs);
	Matrix44&	operator*= (float rhs);
	Matrix44&	operator/= (float rhs);

	//	unary operators
	Matrix44 operator+ () const;
	Matrix44 operator- () const;

	//	binary operators
	Matrix44 operator+ (const Matrix44& rhs) const;
	Matrix44 operator- (const Matrix44& rhs) const;
	Matrix44 operator* (const Matrix44& rhs) const;
	Matrix44 operator* (float rhs) const;
	Matrix44 operator/ (float rhs) const;

	friend Matrix44 operator* (float number, const Matrix44& matrix);

	//	equality operators
	bool operator== (const Matrix44& rhs) const;
	bool operator!= (const Matrix44& rhs) const;

	void SetZero();
	void SetIdentity();
	void SetPerspective(float near_plane, float far_plane, float fov, float aspect);
	void SetLookAt(const Vec3& eye_position, const Vec3& look_target, const Vec3& up_axis);

public:
	union
	{
		struct
		{
			float _11, _12, _13, _14;
			float _21, _22, _23, _24;
			float _31, _32, _33, _34;
			float _41, _42, _43, _44;
		};
		float m[4][4];
	};
};


//-----------------------------------------------------------------------------
//	implementation
//-----------------------------------------------------------------------------
#include "Matrix.inl"